#import <Foundation/Foundation.h>

#import "Car.h"
#import "Engine.h"
#import "AllWeatherRadial.h"


int main (int argc, const char * argv[]) 
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    Car *car = [ [Car alloc] init ];
    Engine *engine = [ [Engine alloc] init ];
    
    for (int i=0; i<4; ++i) 
    {
        AllWeatherRadial *tire = [ [AllWeatherRadial alloc] 
                                  initWithPressure:34.0+i threadDepth:20.0+i ];
        
        [ car setTire:tire atIndex:i ];
        
        [ tire release];
    }
    
    [ car setEngine:engine ];   //since we are using @property: car.engine = engine;
    [ car setName: @"Herbie" ]; //since we are using @property: car.name = @"Herbie";
    
    [ car print ];
    
    //Clean-up memory...
    [ engine release ];
    [ car release ];
    
    [pool drain];
    return 0;
}
